{% extends "base_sub.html" %}

{% block title %}登录{% endblock title %}

{% block content %}
<div id="mb_login" class="mbskin position-relative mt-5 mx-auto mb-0 text-center" style="max-width: 360px;width: 100%;">
    <div class="main-border main-font overflow-hidden">
        <h1 class="blind">登录</h1>
        <div class="row">
            <h2 class="col-6 text-center fs-4 fw-bold py-4"><span class="blind">成员</span>登录</h2>
            <a href="/bbs/register" class="col-6 text-center bov-bg fs-4 sub-font text-decoration-none py-4">成员资格</a>
        </div>
        <form name="flogin" action="/bbs/login" onsubmit="return flogin_submit(this);" method="post">
            <input type="hidden" name="url" value="{{ url }}">
            <fieldset id="login_fs" class="p-5">
                <legend class="blind">会员登录</legend>
                <label for="login_id" class="blind">会员Id<strong class="blind"> 必不可少的</strong></label>
                <input type="text" name="mb_id" id="login_id" required value="{{ mb_id }}" class="frm_input w-100 fs-4 mb-2 required alnum_" size="20" maxLength="20" placeholder="Idie">
                <label for="login_pw" class="blind">密码<strong class="blind"> 必不可少的</strong></label>
                <input type="password" name="mb_password" id="login_pw" required class="frm_input w-100 fs-4 required" size="20" maxLength="20" placeholder="密码">
                <button type="submit" class="btn_submit w-100 fw-bold fs-4 mt-3 py-3 mb-3">登录</button>
                <div id="login_info" class="d-flex justify-content-between">
                    <div class="login_if_auto chk_box">
                        <input type="checkbox" name="auto_login" id="login_auto_login" class="selec_chk">
                        <label for="login_auto_login" class="ps-0 fs-5" ><span class="me-2"></span> 自动登录</label>  
                    </div>
                    <div class="login_if_lpl">
                        <a href="/bbs/id_lost" class="text-decoration-none sub-font fs-5">找到你的ID</a> |
                        <a href="/bbs/password_lost" class="text-decoration-none sub-font fs-5">找到您的密码</a>
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
    {% include "social/social_login.html" %}
</div>

<script>
    jQuery(function($){
        $("#login_auto_login").click(function(){
            if (this.checked) {
                this.checked = confirm("如果您使用自动登录，则无需从以下位置输入会员的姓名和密码:.\n\n请不要在公共场所使用个人信息。.\n\n是否使用自动登录?");
            }
        });
    });

    function flogin_submit(f)
    {
        if( $( document.body ).triggerHandler( 'login_sumit', [f, 'flogin'] ) !== false ){
            return true;
        }
        return false;
    }

</script>
{% endblock content %}